            <!-- Begin: Wrapper Header -->

            <div class="header">
<? Shell::showWidgets('wrapper-header') ?>
            </div> <!-- End -->
            
            <!-- Begin: Content Home -->
            <div class="content home">
                
                <!-- Begin: Banners Middle -->
                <div class="banners-middle">
<?
if (isset(LayoutPage::$banners['middle'])):
    $banners = LayoutPage::$banners['middle'];
    foreach ($banners as $banner):
        if ($banner == null):
?>
                    <a href="javascript:;">
                        <img src="<?= _BNN_IMG_ ?>middle.jpg" alt="Banner" />
                    </a>
<?
        else:
            if (strtolower(pathinfo($banner->filepicture, PATHINFO_EXTENSION)) == 'jpg'):
                if (!$banner->id_enterprise):
?>
                    <a href="<?= $banner->href ?>" target="<?= $banner->target ?>">
<? else: ?>
                    <a href="<?= __BASE_URI__.'revenda/'.urlencode(strtolower(str_replace(' ', '-', $banner->fancyname))).'/'.$banner->e_id ?>">
<? endif ?>
                        <img src="<?= _BNN_IMG_.$banner->filepicture ?>" alt="Banner" />
                    </a>
<? else: ?>
                    <object width="300" height="100">
                        <param name="src" value="<?= _BNN_IMG_.$banner->filepicture ?>">
                        <param name="wmode" value="opaque">
                        <embed src="<?= _BNN_IMG_.$banner->filepicture ?>" width="300" height="100"></embed>
                    </object>
<? if (!$banner->id_enterprise): ?>
                    <a class="flash" href="<?= $banner->href ?>" target="<?= $banner->target ?>"></a>
<? else: ?>
                    <a class="flash" href="<?= __BASE_URI__.'revenda/'.urlencode(strtolower(str_replace(' ', '-', $banner->fancyname))).'/'.$banner->e_id ?>"></a>
<?
                endif;
            endif;
        endif;
    endforeach;
endif
?>
                </div> <!-- End -->
                
                <!-- Begin: Deals -->
                <div class="deals">
                    <h1>Ofertas em destaque</h1>
                    <div class="slider" id="codaslider">
<?
if (Home::$deals):
    foreach (Home::$deals as $vehicle):
        $url = __BASE_URI__.urlencode(strtolower($vehicle->t_name)).'/'.urlencode(strtolower($vehicle->m_name)).'/'.urlencode(strtolower($vehicle->b_name)).'/'.$vehicle->firstreg.'/'.$vehicle->v_id;
?>
                        <div>
                            <div class="block">
                                <a class="picture" href="<?= $url ?>">
                                    <img src="<?= _VHC_IMG_.'deal/'.$vehicle->filename ?>" alt="<?= $vehicle->m_name.' '.$vehicle->c_name.' '.$vehicle->firstreg ?>" />
                                </a>
                                <a class="description" href="<?= $url ?>">
                                    <h2><?= $vehicle->m_name.' '.$vehicle->c_name.' '.$vehicle->firstreg ?></h2>
                                    <h3><?= $vehicle->firstreg.'/'.$vehicle->modelyear.' | '.$vehicle->c_name ?></h3>
                                    <h3><?= $vehicle->f_name ?></h3>
                                </a>
                                <p class="price">
                                    <span class="from">de R$ <?= Util::format_money($vehicle->price) ?></span>
                                    <span class="by">por R$ <?= Util::format_money($vehicle->price-$vehicle->discount) ?></span>
                                </p>
                            </div>
                        </div>
<?
    endforeach;
else:
?>
                        <div>
                            <div class="block">
                                <p class="notfound">Nenhum veículo encontrado</p>
                            </div>
                        </div>
<? endif ?>
                    </div>
                </div> <!-- End -->
                
                <!-- Begin: Last Updated -->
                <div class="last-updated">
                    <h1>Últimos veículos atualizados</h1>
                    <ul>
<?
if (Home::$lastupdated):
    foreach (Home::$lastupdated as $vehicle):
        $url = __BASE_URI__.urlencode(strtolower($vehicle->t_name)).'/'.urlencode(strtolower($vehicle->m_name)).'/'.urlencode(strtolower($vehicle->b_name)).'/'.$vehicle->firstreg.'/'.$vehicle->v_id;
?>
                        <li>
                            <a class="picture" href="<?= $url ?>">
                                <img src="<?= _VHC_IMG_.'last-updated/'.$vehicle->filename ?>" alt="<?= $vehicle->m_name.' '.$vehicle->c_name.' '.$vehicle->firstreg ?>" />
                            </a>
                            <a class="description" href="<?= $url ?>">
                                <h2><?= $vehicle->m_name.' '.$vehicle->c_name.' '.$vehicle->firstreg ?></h2>
                                <h3><?= $vehicle->firstreg.'/'.$vehicle->modelyear.' | '.$vehicle->c_name ?></h3>
                                <h3><?= $vehicle->f_name ?></h3>
                            </a>
                            <p class="price">R$ <?= Util::format_money($vehicle->price-$vehicle->discount) ?></p>
                        </li>
<?
    endforeach;
else:
?>
                        <li class="notfound">Nenhum veículo encontrado</li>
<? endif ?>
                    </ul>
                </div> <!-- End -->
                
                <!-- Begin: Last Products -->
                <div class="last-products">
                    <h1>Produtos e Serviços</h1>
                    <ul>
<?
if (Home::$lastproducts):
    foreach (Home::$lastproducts as $product):
        $url = __BASE_URI__.'produto/'.$product->p_id;
?>
                        <li>
                            <a class="picture" href="<?= $url ?>">
                                <img src="<?= _PDT_IMG_.'last-updated/'.$product->filepicture ?>" alt="<?= $product->p_name ?>" />
                            </a>
                            <a class="description" href="<?= $url ?>">
                                <h2><?= $product->p_name ?></h2>
                            </a>
                            <p class="price">R$ <?= Util::format_money($product->price) ?></p>
                        </li>
<?
    endforeach;
else:
?>
                        <li class="notfound">Nenhum produto ou serviço encontrado</li>
<? endif ?>
                    </ul>
                </div> <!-- End -->
                
                <!-- Begin: Links and Facebook -->
                <div class="links-and-face">
                    
                    <!-- Begin: Useful Links -->
                    <div class="useful-links">
                        <h1>Links</h1>
                        <ul>
                            <li><a href="http://www.planalto.gov.br/ccivil_03/leis/L8078.htm" target="_blank" rel="nofollow">Cód. Defesa Consumidor</a></li>
                            <li><a href="http://www.denatran.gov.br/links.htm" target="_blank" rel="nofollow">Denatran (links úteis)</a></li>
                            <li><a href="http://www.detran.goias.gov.br" target="_blank" rel="nofollow">Detran GO</a></li>
                            <li><a href="http://www.detran.df.gov.br/" target="_blank" rel="nofollow">Detran DF</a></li>
                            <li><a href="http://www.detran.ms.gov.br/" target="_blank" rel="nofollow">Detran MS</a></li>
                            <li><a href="http://www1.dnit.gov.br/rodovias/condicoes/index.htm" target="_blank" rel="nofollow">Estradas</a></li>
                            <li><a href="http://maps.google.com.br" target="_blank" rel="nofollow">Google Maps</a></li>
                            <li><a href="http://www.dprf.gov.br" target="_blank" rel="nofollow">PRF</a></li>
                            <li><a href="http://www.fipe.com.br/web/indices/veiculos/default.aspx?p=51" target="_blank" rel="nofollow">Tabela Fipe</a></li>
                        </ul>
                    </div> <!-- End -->

                    <!-- Begin: Like Box Facebook -->
                    <div class="likebox-facebook">
                        <h1>Facebook</h1>
                        <iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fgoiautos&amp;width=190&amp;height=260&amp;colorscheme=light&amp;show_faces=true&amp;header=false&amp;stream=false&amp;show_border=false" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
                    </div> <!-- End -->
                    
                </div> <!-- End -->
                
                <!-- Begin: News RSS -->
                <div class="news-rss">
                    <h1>Notícias</h1>
                    <ul>
<? foreach(Util::news_rss(6) as $new): ?>
                        <li>
                            <a href="<?= $new->link ?>" target="_blank" rel="nofollow">
                                <img src="<?= $new->image ?>" alt="<?= $new->title ?>" />
                            </a>
                            <div>
                                <h2>
                                    <a href="<?= $new->link ?>" target="_blank" rel="nofollow"><?= $new->title ?></a>
                                </h2>
                                <p><?= $new->description ?></p>
                            </div>
                        </li>
<? endforeach ?>
                    </ul>
                </div> <!-- End -->
                
                <!-- Begin: Banners Lateral -->
                <div class="banners-lateral">
                    <span>Publicidade</span>
                    <ul>
<?
if (isset(LayoutPage::$banners['lateral'])):
    $banners = LayoutPage::$banners['lateral'];
    foreach ($banners as $banner):
        if ($banner == null):
?>
                        <li>
                            <a href="javascript:;">
                                <img src="<?= _BNN_IMG_ ?>lateral.jpg" alt="Banner" />
                            </a>
                        </li>
<?
        else:
?>
                        <li>
<?
            if (strtolower(pathinfo($banner->filepicture, PATHINFO_EXTENSION)) == 'jpg'):
                if (!$banner->id_enterprise):
?>
                            <a href="<?= $banner->href ?>" target="<?= $banner->target ?>">
<? else: ?>
                            <a href="<?= __BASE_URI__.'revenda/'.urlencode(strtolower(str_replace(' ', '-', $banner->fancyname))).'/'.$banner->e_id ?>">
<? endif ?>
                                <img src="<?= _BNN_IMG_.$banner->filepicture ?>" alt="Banner" />
                            </a>
<? else: ?>
                            <object width="180" height="50">
                                <param name="src" value="<?= _BNN_IMG_.$banner->filepicture ?>">
                                <param name="wmode" value="opaque">
                                <embed src="<?= _BNN_IMG_.$banner->filepicture ?>" width="180" height="50"></embed>
                            </object>
<? if (!$banner->id_enterprise): ?>
                            <a class="flash" href="<?= $banner->href ?>" target="<?= $banner->target ?>"></a>
<? else: ?>
                            <a class="flash" href="<?= __BASE_URI__.'revenda/'.urlencode(strtolower(str_replace(' ', '-', $banner->fancyname))).'/'.$banner->e_id ?>"></a>
<?
                endif;
            endif;
?>
                        </li>
<?
        endif;
    endforeach;
endif
?>
                    </ul>
                </div> <!-- End -->
                
            </div> <!-- End -->
